package com.cyanite.playlv2api.parsers.json;

import com.cyanite.playlv2api.types.Score;

import org.json.JSONException;
import org.json.JSONObject;

public class ScoreParser extends AbstractParser<Score> {

    @Override
    public Score parse(JSONObject json) throws JSONException {
        Score obj = new Score();
        if (json.has("icon")) {
            obj.setIcon(json.getString("icon"));
        }
        if (json.has("message")) {
            obj.setMessage(json.getString("message"));
        }
        if (json.has("points")) {
            obj.setScores(json.getString("points"));
        }

        return obj;
    }
}